<%@page import="org.apache.struts2.ServletActionContext"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>  
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>订餐系统</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="订餐系统">
	<link rel="stylesheet" type="text/css" href="css/styles.css">
	<script src="js/jquery-1.6.2.min.js" type="text/javascript"></script>
	<script src="js/bookdinner.js" type="text/javascript"></script>
	<script src="js/jquery-ui-1.8.20.custom.min.js" type="text/javascript"></script>
  </head>
  
  <body>
  <%
  	String basepath = request.getContextPath();
	HttpSession seeion = ServletActionContext.getRequest().getSession();
	if(session == null ||session.getAttribute("user")==null || session.getAttribute("user").toString().equals(""))
	{
 	%>
   <div><span id="loginLabel"><a href="login.jsp?type=1">登录</a></span> 或<span><a href="login.jsp?type=0">注册</a></span></div>
   <div><span><a href="manager_login.jsp?type=1">企业登录</a></span> 或<span><a href="manager_login.jsp?type=0">企业注册</a></span></div>
   <%}else { %>
   <%=session.getAttribute("user").toString()%>，您好！<br/><%--
   <s:property value="name"/>,您好！
   --%><%} %>
   <%--<s:if test="role!=null && role.equals('manager')">
   <a href="">添加商店</a>
   </s:if>
   --%><hr/>
   <s:if test="restaurants.size>0">
   		<s:iterator value="restaurants" var="r">
   			<div>
   				<img alt="restaurant" class="restaurant-img" src="<%=basepath%>/img/restaurant/restaurant.jpg" width="220" height="160"><br/>
   				<s:property value="#r.name"/><br/>
   				<span>好评:<s:property value="#r.goodRepNum" /></span>
   				<span>中评:<s:property value="#r.middleRepNum" /></span>
   				<span>差评:<s:property value="#r.badRepNum" /></span><br/>
   			</div>
   			<hr/>
   		</s:iterator>
   </s:if>
   
   
  </body>
</html>
